function [freqs, fidSpectrum] = GET_ShockFIDSpectrum(obj, varargin)
%GET_SHOCKFIDSPECTRUM Summary of this function goes here
%   Detailed explanation goes here
    L = log4m.getLogger;
    
    p = inputParser;
    p.addParameter('strength', 5.0, @(x) isscalar(x) && x >0);
    p.addParameter('waiting', 5.0, @(x) isscalar(x) && x >0 && x < 20);
    p.addParameter('isAddToSession', false, @islogical);
    p.parse(varargin{:});
    
    obj.controller.unLockMagnetometerTransverseFieldZ();
    volt = obj.controller.getCurrentControlVoltZ();
    obj.controller.setCurrentControlVoltZ( min(volt+p.Results.strength, 9.5) ); pause(0.1);
    obj.controller.setCurrentControlVoltZ( volt );
    pause(0.5);
    obj.controller.lockMagnetometerTransverseFieldZ();
    pause(p.Results.waiting);

    %%
    zi = obj.controller.ziMaster();
    spect = zi.spectrumModule();
    spect.setControl('grid_repetitions', 20);
    spect.setParam('spectrum/frequencyspan', 1000);
    spect.setParam('grid/cols', 8192);

    spect.reset();
    spect.subscribeChannel('1', 'sample.X.fft.abs.avg');
    fidSpectrum= spect.run();
    spect.unsubscribeChannel();

    %%
    ch = obj.controller.DemodSettings.ByDemodFast.index;
    spect_data=fidSpectrum.getNodeData(ch, 'sample_x_fft_abs_avg');
    [~, locs, ~, ~]=findpeaks(spect_data.value, spect_data.freq, 'Npeak', 2, 'SortStr', 'descend');
    
    %%
    f129 = locs(1); f131 = f129/3.37340; f131_meas = locs(2);
    if abs(locs(1)/locs(2) - 3.3734) > 0.001
        L.info('XeNMRSystem::GET_ShockFIDSpectrum', sprintf('f131 determined by theoretical ratio. r=%8.6f', locs(1)/locs(2)) );
    end
    freqs = [f129, f131, f131_meas];
    
    obj.resonance129.frequency = f129;
    obj.resonance131.frequency = f131;
    obj.go2Resonance();
    %%
    if p.Results.isAddToSession
        spect.addToSession('ShockFIDSpectrum');
    end
end

